Cisco Router OSPF Design and Implementation Guide William Parkhurst, PhD, CCIE $54.95 0-07-048626-3 |
![]() ![]() |
Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
Reserve your copy at a Beta Bookstore near you! |
Contact Bet@books © 1998 The McGraw-Hill Companies, Inc. All rights reserved. Any use of this Beta Book is subject to the rules stated in the Terms of Use. |
When a host, whether it is a workstation or a router, sends a packet to another node on an ethernet network, the address that the packet is sent to is an ethernet or MAC address. If our hosts, workstations and routers, want to send a packet to an IP address, then the host must determine the ethernet address of the host with the specified IP address. This process of mapping an IP address to an ethernet address is called address resolution and the protocol used is ARP.
Address Resolution – One Network
Let’s assume that host 1 in figure 4.1 wants to send an IP packet to host 3. Since hosts 1 and 3 are on the same physical network they must also be on the same IP network. Host 1 realizes that host 3 is on the same IP subnet because the subnet mask is /16 so every host with an IP address starting with 156.26 is on the same subnet. Host 1 will first send and ARP request packet (Figure 4.2) as an ethernet broadcast. A broadcast is used since host 1 does not know the ethernet address of host 3 but assumes host 3 is on the same ethernet segment. Of course if host 3 is not on the same ethernet segment, either the destination IP address has not been assigned to a host or the network has been designed incorrectly, then host 1 will not be able to resolve the ethernet to IP address mapping.
When host 1 is initially booted it has no knowledge of any of the other hosts on the network. The only information available (hopefully) is the IP address and subnet mask.
Figure 4.1. Single IP Network
0 8 16 31
Hardware Type 1 = Ethernet |
Protocol Type 0x0800 = IP |
|
Hardware Length 6 for Ethernet |
Protocol Length 4 for IP |
Operation 1 – ARP Request 2 – ARP Reply |
Sender Hardware Address Octets 0 - 3 |
||
Sender Hardware Address Octets 4 and 5 |
Sender IP Address Octets 0 and 1 |
|
Sender IP Address Octets 2 and 3 |
Target Hardware Address Octets 0 and 1 |
|
Target Hardware Address Octets 2 – 5 |
||
Target IP Address |
Figure 4.2. ARP Packet Format
Some application such as ftp or telnet requires communication with host 3 at an IP address 156.25.3.3. Host 1 has to determine the ethernet address that corresponds to that IP address using ARP. Host 1 will build an ARP packet with the format shown in figure 4.2. The ARP packet format was designed to operate with multiple hardware address to network address pairs but for our discussion we will be only concerned with IP to ethernet address mappings. The following steps occur as host 1 attempts to resolve the ethernet address of host 3 and are shown graphically in figure 4.3.
Figure 4.3. ARP Sequence of Events
Address Resolution – Multiple Networks
Figure 4.4 illustrates the situation where a host wants to send an IP packet to a host on a different subnet. Using the same procedure as for a single network let’s see what happens when host 156.26.1.1 tries to send an ARP request to host 156.26.2.1. Host 156.26.1.1 sends an ethernet broadcast containing and ARP request for the ethernet address corresponding to IP address 156.26.2.1 (Figure 4.5).
Figure 4.4. Multiple Network Address Resolution.
Figure 4.5. Trying to ARP Across Networks
The router examines the ARP request and determines that the request is not for it’s IP address so it will ignore the frame. Also, the router will not forward an ethernet broadcast so host 156.26.2.1 will never see the ARP request. How do we solve this problem? Host 156.26.1.1 knows from the /24 subnet mask and from the IP address of host 2 that host 2 is on a different subnet so the solution is easy, let the router worry about it. Each host on the network should be configured with a default gateway. The default gateway is where all frames are sent if the destination is on a different network or subnet. Host 1’s default gateway will be 156.26.1.2, which is the address of the router interface connected to network where host 1 lives. Host 1 will send the IP packet to the router but it must first use ARP to resolve the ethernet address of the router’s interface (figure 4.6a). The router will reply with its ethernet address (figure 4.6 b) and host 1 will send the IP packets to the router (figure 4.6 c).
Now that the router is receiving IP packets form 156.26.1.1 what does it do with them? Of course they need to be sent to 156.26.2.1 but the router does not know the ethernet address of 156.26.2.1 (we are assuming that the router was recently booted and the ARP cache is empty). The solution is simple! The router will broadcast an ARP request on network 156.26.2.0/24 and 156.26.2.1 will respond with its ethernet address.
Exercise 4.1
Exercise 4.2
![]() ![]() Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
Reserve your copy at a Beta Bookstore near you! |
Contact Bet@books © 1998 The McGraw-Hill Companies, Inc. All rights reserved. Any use of this Beta Book is subject to the rules stated in the Terms of Use. |